<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html;charset=utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>双色球计算器</title>
<script type="text/javascript"
	src="<c:url value='/scripts/lib/jquery-1.8.2.min.js'/>"></script>
</head>
<body>
	<h2>请输入计算条件</h2>
	<form:form method="post" action="calculate" modelAttribute="redForm"
		id="redForm" cssClass="well form-horizontal">
		<table width="100%">
			<tr>
				<td>余3比</td>
				<td width="90%"><form:select path="mod3"
						items="${redForm.mod3List}" /></td>
			</tr>
			<tr>
				<td>偶数个数</td>
				<td><form:select path="mod2">
						<form:option value="" label="--- 请选择 ---" />
						<form:options items="${redForm.mod2List}" />
					</form:select></td>
			</tr>
			<tr>
				<td>质数个数</td>
				<td><form:select path="prime">
						<form:option value="" label="--- 请选择 ---" />
						<form:options items="${redForm.primeList}" />
					</form:select></td>
			</tr>
			<tr>
				<td>连号位置</td>
				<td><form:select path="adjacent">
						<form:option value="" label="--- 请选择 ---" />
						<form:options items="${redForm.adjacentList}" />
					</form:select></td>
			</tr>
			<tr>
				<td>重号个数</td>
				<td><form:select path="duplication">
						<form:option value="" label="--- 请选择 ---" />
						<form:options items="${redForm.duplicationList}" />
					</form:select></td>
			</tr>
		</table>
		<table id="advOptionTable" style="display: none" width="100%">
			<tr>
				<td>自定义求与规则</td>
				<td width="90%"><input type="text" name="andRule"
					value="${redForm.andRule }" /></td>
			</tr>
			<tr>
				<td>自定义运算规则</td>
				<td><input type="text" name="logicRule"
					value="${redForm.logicRule }" width="100" /></td>
			</tr>
			<tr>
				<td>自定义重叠规则</td>
				<td><input type="text" name="dupRule"
					value="${redForm.dupRule }" /></td>
			</tr>
		</table>
		<table>
			<tr>
				<td colspan="2"><input type="submit" name="calculate"
					class="btn" value="计算" /><input type="button" name="advOptionBtn"
					class="btn" value="高级" onclick="$('#advOptionTable').toggle();" /></td>
			</tr>
		</table>
	</form:form>
	<c:if test="${redballs != null}">
		<h3>总计查询到:${fn:length(redballs)}，耗时${redForm.time}毫秒。</h3>
	</c:if>
	<table width="100%"
		class="table table-condensed table-striped table-hover">
		<tr>
			<td>序号</td>
			<td>红1~6</td>
			<td>余三比</td>
			<td>偶奇比</td>
			<td>质合比</td>
			<td>尾数比</td>
			<td>和值</td>
		</tr>
		<c:forEach items="${redballs}" var="redball" varStatus="s">
			<tr>
				<td>${s.count}</td>
				<td>${redball.red1} &nbsp; ${redball.red2} &nbsp;
					${redball.red3} &nbsp; ${redball.red4} &nbsp; ${redball.red5}
					&nbsp; ${redball.red6}</td>
				<td>${redball.mod3_0}:${redball.mod3_1}:${redball.mod3_2}</td>
				<td>${redball.mod2_0}:${6-redball.mod2_0}</td>
				<td>${redball.prime}:${6-redball.prime}</td>
				<td>${redball.mod10_0}:${redball.mod10_1}:${redball.mod10_2}:${redball.mod10_3}:${redball.mod10_4}:${redball.mod10_5}:${redball.mod10_6}:${redball.mod10_7}:${redball.mod10_8}:${redball.mod10_9}
				</td>
				<td>${redball.red1+redball.red2+redball.red3+redball.red4+redball.red5+redball.red6}</td>
			</tr>
		</c:forEach>
	</table>

</body>
</html>
